package com.sisyphus.spinach.ui.configs.impl;

import android.view.ViewGroup;


import com.sisyphus.spinach.core.INetTask;

import androidx.annotation.NonNull;
import androidx.lifecycle.Lifecycle;

public abstract class DefaultTemplate<T> implements ITemplate<T> {

    protected final ViewGroup mParent;

    public DefaultTemplate(ViewGroup parent) {
        mParent = parent;
    }

    @Override
    public void execute(@NonNull Lifecycle lifecycle) {
        INetTask.Presenter<T, INetTask.View<T>> presenter = presenter();
        presenter.bind(view());
        lifecycle.addObserver(presenter);
        presenter.execute();
    }

}
